// CG Table 组件样式

// 主容器样式
.cg-table {
  box-sizing: border-box;
  width: 100%;
  min-height: 100px;
  background-color: #ffffff;
  border-radius: 4px;
  overflow: hidden;
}

// 内容区域样式
.cg-table-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

// 表头容器样式
.cg-table__header-wrapper {
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  border-top: 1px solid #ebeef5;
  border-left: 1px solid #ebeef5;
  border-right: 1px solid #ebeef5;
  background-color: #fafafa;
}

// 表体容器样式
.cg-table__body-wrapper {
  width: 100%;
  overflow: hidden;
  box-sizing: content-box;
  border-left: 1px solid #ebeef5;
  border-right: 1px solid #ebeef5;
  border-bottom: 1px solid #ebeef5;
}

// 表格基础样式
.cg-table__head,
.cg-table__body {
  table-layout: fixed;
  border-collapse: collapse;
  box-sizing: border-box;
  width: 100%;
}

// 表头样式
.cg-table__head {
  background-color: #fafafa;
}

// 表体样式
.cg-table__body {
  background-color: #ffffff;
}

// 表格行悬停效果
.cg-table__body tr:hover > td.cg-table__cell {
  background-color: #f5f7fa;
}

// 单元格基础样式
.cg-table__cell {
  padding: 12px 0;
  min-width: 0;
  box-sizing: border-box;
  text-overflow: ellipsis;
  vertical-align: middle;
  position: relative;
  text-align: left;
  border-bottom: 1px solid #ebeef5;
}

// 表头单元格样式
.cg-table__head th.cg-table__cell {
  color: #909399;
  font-weight: 500;
  border-right: 1px solid #ebeef5;
}

.cg-table__head th.cg-table__cell:last-child {
  border-right: none;
}

// 表体单元格样式
.cg-table__body td.cg-table__cell {
  border-right: 1px solid #ebeef5;
}

.cg-table__body td.cg-table__cell:last-child {
  border-right: none;
}

// 单元格内容样式
.cell {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-all;
  line-height: 23px;
  padding-left: 10px;
  padding-right: 10px;
}

// 操作列样式
.operation-cell {
  padding: 8px 0;
}

// 分页容器样式
.cg-table__pagination {
  text-align: right;
  padding: 10px 16px;
  box-sizing: border-box;
  border-top: 1px solid #ebeef5;
  background-color: #fafafa;
}

// 空数据提示样式
.cg-table__empty-block {
  min-height: 160px;
  height: 100%;
  text-align: center;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid #ebeef5;
  border-bottom: 1px solid #ebeef5;
}

.cg-table__empty-text {
  line-height: 60px;
  color: #909399;
  font-size: 14px;
}

// 响应式适配
@media screen and (max-width: 768px) {
  .cg-table {
    font-size: 13px;
  }
  
  .cg-table__cell {
    padding: 8px 0;
  }
  
  .cell {
    padding-left: 8px;
    padding-right: 8px;
    line-height: 20px;
  }
  
  .cg-table__empty-block {
    min-height: 120px;
  }
}
